<template>
  <div>
    <div class="itemdiv" v-for="(item,index) in cardList" :key="index" @click="imgTab">
      <div class="itemimg"><img :src="item.picUrl" alt="" ></div>
      <div class="usecode" v-if="item.type == 1">{{item.userCardCode}}</div>
    </div>
  </div> 
</template>
<script>
  export default{
    props:{
      cardList:{
        type: Array,
      },
    },
    methods:{
      imgTab(){
        console.log("我点击了图片")
      }
    },
  }
</script>
<style scoped>
.itemdiv{
  width: 690rpx;
  height: 380rpx;
  position: relative;
  overflow: hidden;
  margin: 20rpx auto;
}
.itemimg{
  width: 100%;
  height: 100%;
}
.itemimg img{
  width: 100%;
  height: 100%;
  display: block;
}
.usecode{
  position: absolute;
  right: 33rpx;
  bottom: 22rpx;
  font-size: 24rpx;
  color: #d99a4d;
}
</style>